<template lang="">
    <div class="box" >
       <div class="box" ref="box"></div>
    </div>
</template>
<script>
import * as echarts from "echarts"
export default {
    data() {
        return {

        }
    },
    mounted() {
        this.echar()
    },
    methods: {
        echar() {
            let mychart = echarts.init(this.$refs.box)
            
            let option = {
                title: {
                    text: "境外输入病情top10省份",
                    textStyle: {
                        color: "#fff",
                        fontWeight: 100,
                    },
                    left: "center",
                },
                grid:{
                    bottom:0
                },
                series: [
                    {
                        type: "pie",
                        label: {
                            fontSize: 10,
                            formatter: "{b}",
                            textBorderColor: "none",
                            color: "#fff",
                        },
                        roseType: true,
                        left: "55",
                        top: "30",
                        width: "300px",
                        height: "150px",
                        radius: ["15%", "90%"],
                        data: [
                            { value: 32, name: "上海" },
                            { value: 18, name: "广东" },
                            { value: 12, name: "黑龙江" },
                            { value: 10, name: "四川" },
                            { value: 8, name: "陕西" },
                            { value: 6, name: "内蒙古" },
                            { value: 5, name: "福建" },
                            { value: 4, name: "北京" },
                            { value: 3, name: "天津" },
                            { value: 2, name: "山西" },
                        ],
                    },
                ],
            }
            mychart.setOption(option)
        }
    }
}
</script>
<style lang="less" scoped>
.box {
    width: 400px;
    height: 220px;
    // border: 1px solid #000;
}
</style>